<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" import="com.ffcs.crmd.platform.ui.utils.JspUtil"%>
<!DOCTYPE html>
<jsp:include page="/resources/theme/default/include/default-header-inc.jsp"></jsp:include>
<jsp:include page="/resources/theme/default/include/default-footer-inc.jsp"></jsp:include>
<html>
<head>
<title>菜单管理</title>
<link rel="stylesheet" href="<%=JspUtil.path(request)%>/tsp/css/public.css"/>
<script type="text/javascript" src="../job/js/job-service.js"></script>
<script type="text/javascript" src="./js/job-detail-service.js"></script>
<script type="text/javascript" src="./js/job-detail-param-service.js"></script>
<script type="text/javascript" src="../job-detail-track/js/job-detail-track-service.js"></script>
<script type="text/javascript" src="../job-detail-death/js/job-detail-death-service.js"></script>
<script type="text/javascript" src="../public/public-service.js"></script>
<script type="text/javascript" src="./js/job-detail-controller.js"></script>
<script type="text/javascript" src="../job-detail-retry/js/job-detail-retry-controller.js"></script>
<script type="text/javascript" src="../job-detail-running/js/job-detail-running-controller.js"></script>
<script type="text/javascript" src="../job-detail-death/js/job-detail-death-controller.js"></script>
</head>
<body ng-app="jobDetailApp" ng-controller="jobDetailCtrl" style="background-color: transparent;">
	<div style="margin-top: 12px;">
		<div class="panel">
			<div class="panel-heading">
				<i class="mark"></i>子任务信息
			</div>
			<div class="panel-body" style="padding-top: 0px;">
				<div id="jobDetailToolbar" class="btn-group" style="width: 100%;">
					<button id="jobDetailAddButton" class="btn btn-sm btn-blue" data-toggle="modal" data-target="#jobDetailModal"
						ng-click="action='ADD'" ng-show="userName == 'admin'" >
						<i class="glyphicon glyphicon-plus-sign"></i> 新增
					</button>
					<button id="jobDetailRemoveButton" class="btn btn-sm btn-danger" ng-click="deleteJobDetail();" 
						ng-show="userName == 'admin'" disabled>
						<i class="glyphicon glyphicon-remove"></i> 删除
					</button>
					<button id="jobDetailStopButton" class="btn btn-sm btn-warning" ng-click="pauseJobDetail();" disabled>
						<i class="glyphicon glyphicon-pause"></i> 暂停
					</button>
					<button id="jobDetailResumeButton" class="btn btn-sm btn-warning" ng-click="resumeJobDetail();" disabled>
						<i class="glyphicon glyphicon-stop"></i> 唤醒
					</button>
					
					<form class="form-inline pull-right">
						<div class="search-inline">
							<label>任务名称：</label> 
							<input select2 type="text" class="form-control input-sm" ng-model="jobDetailVO.queryJobId" config="jobSelectConfig" style="width: 300px;"/>
							<label>子任务名称：</label> 
							<input type="text" class="form-control input-sm" ng-model="jobDetailVO.queryName" style="width: 250px;">
							<button type="button" class="btn btn-sm btn-blue" ng-click="queryJobDetail();">查询</button>
						</div>
					</form>
				</div>
				<div class="table-responsive">
					<table id="jobDetailTable"
						data-id-field="id"
						data-side-pagination="server" 
						data-toolbar="#jobDetailToolbar" 
						data-click-to-select="true"
						data-pagination="true" 
						data-page-size="10"
						data-query-params-type="" 
						data-detail-view="true"
						data-page-list="[5, 10, 20]">
						<thead>
							<tr>
								<th data-checkbox='true' />
								<th data-field="name" data-align="center" data-valign="middle" data-class="table-column" data-width="21%">子任务名称</th>
								<th data-field="jobName" data-align="center" data-valign="middle" data-class="table-column" data-width="19%">任务名称</th>
								<th data-field="prevTime" data-align="center" data-valign="middle" data-class="table-column" data-width="13%">上次运行时间</th>
								<th data-field="nextTime" data-align="center" data-valign="middle" data-class="table-column" data-width="13%">下次运行时间</th>
								<th data-field="runtimes" data-align="center" data-valign="middle" data-class="table-column" data-width="5%">运行次数</th>
								<th data-field="jobDetailState" data-align="center" data-valign="middle" data-class="table-column" data-width="5%" data-formatter="filedRunningFormatter">状态</th>
								<th data-width="24%" data-align="center" data-valign="middle" data-class="table-column operation" 
									data-events="jobDetailOperEvents" data-formatter="jobDetailOperFormatter">查看操作</th>
							</tr>
						</thead>
					</table>
				</div>
			</div>
		</div>
	</div>
	
	<jsp:include page="./job-detail-modal.jsp"></jsp:include>
	<jsp:include page="./job-detail-config-modal.jsp"></jsp:include>
	<jsp:include page="./job-detail-param-modal.jsp"></jsp:include>
	
	<div ng-controller="jobDetailDeathController">
		<jsp:include page="../job-detail-death/job-detail-death.jsp"></jsp:include>
	</div>
	<div ng-controller="jobDetailRetryController">
		<jsp:include page="../job-detail-retry/job-detail-retry.jsp"></jsp:include>
	</div>
	<div ng-controller="jobDetailRunningController">
		<jsp:include page="../job-detail-running/job-detail-running.jsp"></jsp:include>
		<jsp:include page="../job-detail-running/job-detail-thread-info-modal.jsp"></jsp:include>
	</div>
</body>
</html>